//
//  HELRankingListVC.m
//  NursingAssociation
//
//  Created by wsj2015 on 2017/2/17.
//  Copyright © 2017年 wsj2015. All rights reserved.
//

#import "HELRankingListVC.h"
#import "HELCourseListTableView.h"
@interface HELRankingListVC ()

@property (nonatomic,  strong) NSArray *courseTypes;


@end

@implementation HELRankingListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
//    [self addLine];
    self.title = @"热门排行";
   
    
    
    
}

- (void)searchJump{

}


- (NSArray *)courseTypes{
    if (!_courseTypes) {
        _courseTypes = @[@"在线排行"];
    }
    return _courseTypes;
}

- (instancetype)init {
    if (self = [super init]) {
        self.titleSizeNormal = 17;
        self.titleSizeSelected = 17;
        self.menuViewStyle = WMMenuViewStyleLine;
        self.menuItemWidth = [UIScreen mainScreen].bounds.size.width / self.courseTypes.count;
        self.menuHeight = 0;
        self.menuView.speedFactor = 3;
      
        self.menuBGColor = [UIColor whiteColor];
        self.titleColorSelected =kMainColor;
        self.titleColorNormal =[UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:1.0];
    }
    return self;
}
- (void)addLine{
    UIView *line = [UIView new];
    line.backgroundColor = kBorderColor;
    line.frame = CGRectMake(0, 48, kScreenWidth, 1);
    [self.menuView insertSubview:line atIndex:0];
    
}

#pragma mark - Datasource & Delegate
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return self.courseTypes.count;
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    
    if (index == 0) {
        HELCourseListTableView * vc = [HELCourseListTableView new];
        
        return  vc;
    }else{
        HELCourseListTableView * vc = [HELCourseListTableView new];
        vc.isOnline = NO;
        return vc;
    }
   
}

- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    return self.courseTypes[index];
}
- (void)pageController:(WMPageController *)pageController willEnterViewController:(__kindof UIViewController *)viewController withInfo:(NSDictionary *)info{
    
    HELCourseListTableView *vc = viewController;
    [vc requestDataFirst];
    
}


@end
